package ipmsg.menu;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JSeparator;

import ipmsg.StartFrame;

public class MenuSystem extends JMenu {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6207604868269205636L;

	private StartFrame start;

	private JMenuItem jMenuItem1 = new JMenuItem();
	private JMenuItem jMenuItem2 = new JMenuItem();
	private JMenuItem jMenuItem3 = new JMenuItem();
	private JMenuItem jMenuItem4 = new JMenuItem();
	private JMenuItem jMenuItem5 = new JMenuItem();
	private JMenuItem jMenuItem6 = new JMenuItem();
	private JMenuItem jMenuItem7 = new JMenuItem();

	public MenuSystem(StartFrame start) {
		super("系统");
		this.start = start;
		initComponents();
	}

	private void initComponents() {
		this.jMenuItem1.setText("刷新好友列表");
		this.jMenuItem1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				start.jMenuItem1ActionPerformed(evt);
			}
		});
		this.add(this.jMenuItem1);

		this.jMenuItem2.setText("查看好友信息");
		this.jMenuItem2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				start.jMenuItem2ActionPerformed(evt);
			}
		});
		this.add(this.jMenuItem2);
		this.add(new JSeparator());

		this.jMenuItem3.setText("查看本地IP列表");
		this.jMenuItem3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				start.jMenuItem3ActionPerformed(evt);
			}
		});
		this.add(this.jMenuItem3);

		this.jMenuItem4.setText("刷新本地IP信息");
		this.jMenuItem4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				start.jMenuItem4ActionPerformed(evt);
			}
		});
		this.add(this.jMenuItem4);
		this.add(new JSeparator());

		this.jMenuItem5.setText("加入黑名单");
		this.jMenuItem5.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				start.jMenuItem5ActionPerformed(evt);
			}
		});
		this.add(this.jMenuItem5);
		this.add(new JSeparator());

		this.jMenuItem6.setText("关于");
		this.jMenuItem6.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				start.jMenuItem6ActionPerformed(evt);
			}
		});
		this.add(this.jMenuItem6);

		this.jMenuItem7.setText("退出");
		this.jMenuItem7.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				start.jMenuItem7ActionPerformed(evt);
			}
		});
		this.add(this.jMenuItem7);
	}

}
